package org.zhengquan.vo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * @author zhengquan
 * @date 2017/10/31
 */
@Getter
@Setter
@ToString

public class UserVO {
    private Integer id;

    @NotBlank(message = "用户名不可以为空")
    @Length(min = 1, max = 20, message = "用户名长度需要在1-20个字之内")
    private String username;

    @NotBlank(message = "电话不可以为空")
    @Length(min = 1, max = 13, message = "电话长度需要在1-13个字之内")
    private String telephone;

    @NotBlank(message = "邮箱不可以为空")
    @Email(message = "邮箱格式不合法")
    private String mail;

    @Length(max = 200, message = "备注长度需要在200个字之内")
    private String remark;

    @NotNull(message = "必须提供用户所在部门")
    private Integer deptId;

    @NotNull(message = "必须指定用户的状态")
    @Range(min = 0, max = 2, message = "用户状态不合法")
    private Short state;
}
